# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=py3-faker
_pyname=Faker
pkgver=4.1.1
pkgrel=0
pkgdesc="Python package that generates fake data for you"
url="https://faker.readthedocs.io/en/master"
arch="noarch"
license="MIT"
depends="py3-dateutil py3-setuptools py3-six py3-text-unidecode"
checkdepends="py3-email-validator py3-ipaddress py3-mock py3-freezegun
	py3-more-itertools py3-pytest py3-ukpostcodeparser py3-validators
	py3-pytest-runner"
_pypiprefix="${_pyname%${_pyname#?}}"
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
builddir=$srcdir/$_pyname-$pkgver

replaces="py-faker" # Backwards compatibility
provides="py-faker=$pkgver-r$pkgrel" # Backwards compatibility

prepare() {
	default_prepare
	# tests erroneously require a specific version of pytest
	sed -i setup.py -e 's/ *"pytest>=.*//g'
}

build() {
	python3 setup.py build
}

check() {
	# Uses random2 which is not packaged
	rm -f tests/providers/test_ssn.py
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="251bca49a402218b9dee0372f650b891d35c70605dc0bc0e68f301dfd06fc25959489fb45fb4b460a8a46b9fe0be85307eeb6548852fe1b79f87bd409266028f  Faker-4.1.1.tar.gz"
